/**
 * File Comment: Ita a GUI
 */
package edu.gatech.oad.project.presentation;

import javax.swing.JFrame;

import edu.gatech.oad.project.networking.ClientSession;

/**
 * This class is a driver to connect 
 * the panels for the GUI.
 * 
 * @author Group 17
 * @version 1
 */
public class Driver{
  
    /**
     * Field session: the session 
     */
    private ClientSession session;
    
  /**
   * Field frame: displays the panels for the GUI
   */
  private final JFrame frame;
  
  /**
   * Field curUser: the name of the user interacting
   * with the GUI
   */
  private String curUser;
  
  /**
   * Field login: the LogIn controlling the login logic
   */
  private final LogIn login;
  
  /**
   * Field d: DoctorHome panel for the GUI
   */
  private final DoctorHome d;
  
  /**
   * Field n: NurseHome panel for the GUI
   */
  private final NurseHome nH;
  
  /**
   * Field p: PatientHome panel for the GUI
   */
  private final PatientHome pH;
  
  /**
   * Field s: SysAdminHome panel for the GUI
   */
  private final SysAdminHome s;
  
  /**
   * Constructor.
   */
  public Driver() {

    this.frame = new JFrame();
    this.login = new LogIn(this);

    this.d = new DoctorHome(this);
    this.nH = new NurseHome(this);
    this.pH = new PatientHome(this);
    this.s = new SysAdminHome(this);
  } // end constructor method
   
  /**
   * Get the GUI frame.
   * 
   * @return the JFrame
   */
  public JFrame getFrame() {
    return this.frame;
  } // end getFrame method
  
  /**
   * Set the current user.
   * 
   * @param username the name of the new current user.
   */
  public void setCurUser(String username) {
    this.curUser = username;
  } // end setCurUser method
  
  /**
   * Get the LogIn.
   * 
   * @return the LogIn controlling the login logic
   */
  public LogIn getLogin() {
    return this.login;
  } // end getLogin method
  
  /**
   * Get the doctor's home panel.
   * 
   * @return the DoctorHome panel
   */
  public DoctorHome getD() {
    return this.d;
  } // end getD method
  
  /**
   * Get the nurse's home panel.
   * 
   * @return the NurseHome panel
   */
  public NurseHome getN() {
    return this.nH;
  } // end getN method
  
  /**
   * Get the patient's home panel.
   * 
   * @return the PatientHome panel
   */
  public PatientHome getP() {
    return this.pH;
  } // end getP method
  
  /**
   * sets the session of the driver
   * 
 * @param session the server session
 */
public void setSession(ClientSession session) {
      this.session = session;
  }
  
  /**
   * Gets the server connection
   * 
 * @return the server connection
 */
public ClientSession getSession() {
      return session;
  }
  
  /**
   * Get the system administrator's home panel.
   * 
   * @return the SysAdminHome panel
   */
  public SysAdminHome getS() {
    return this.s;
  } // end getS method

/**
 * @return a string
 */
@Override
public String toString() {
	return "Driver [session=" + session + ", frame=" + frame + ", curUser="
			+ curUser + ", login=" + login + ", d=" + d + ", n=" + nH + ", p="
			+ pH + ", s=" + s + "]";
}
  
  
} // end Driver class